package com.hl.sfzy.service.myService;

import com.hl.sfzy.entity.my.MyAnswer;
import com.hl.sfzy.mapper.my.MyAnswerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

@Service
public class MyAnswerService {
    @Autowired
    private MyAnswerMapper myAnswerMapper;

    public List<MyAnswer> myAnswerList(int userId, int pageNo, int pageSize) {
        int offset = (pageNo - 1) * pageSize;
        return myAnswerMapper.myAnswerList(userId, offset, pageSize);
    }

    public int countMyAnswers(int userId) {
        return myAnswerMapper.countMyAnswers(userId);
    }
}